<?php
/**
 * class App_Model_Log
 *
 * @author kim
 */
class App_Model_Log extends App_Model_Abstract
{
    /**
     * log the exception
     *
     * @param exception $e
     * @return null
     */
    static public function write($e)
    {
        if ($e instanceof Exception) {
            if ($errDir = realpath(APPLICATION_PATH . '/../data/log/')) {
                if (is_writable($errDir)) {
                    $log = new Zend_Log(new Zend_Log_Writer_Stream($errDir . '/err_' . date('Y-m-d') . '.log', 'a'));
                    $log->debug($e->getMessage() . "\n" .
                                $e->getTraceAsString() . "\n\n");
                }
            }
        }
    }

}
